#include <stdio.h>
#include <stdlib.h>
int day[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main(int argc, char *argv[])
{
    int i, j, cnt = -1, ans = 0;
    for (i = 1; i <= 12; i++)
    {
        for (j = 1; j <= day[i]; j++)
        {
            cnt++;
            if (cnt % 7 == 1 || i % 10 == 1 || i / 10 % 10 == 1 || j % 10 == 1 || j / 10 % 10 == 1)
                ans += 5;
            else
                ans++;
        }
    }
    printf("%d", ans);
    return 0;
}